const koa = require('koa');
const mysql = require('koa-mysql');

//let db = mysql.createPool({"host": "localhost", "user": "root","password": "", "database": "albert"})
let db = mysql.createPool({host: `localhost`, user: `root`,password: ``, database: `albert`})
let server = new koa();

server.use(function *(){
  let data = yield db.query(`select * from user`);
  this.body = data;
});

server.listen(8080);
